<?php
/**
 * Абстрактный MVC-путь
 *
 * @since 06.11.2011
 * @author Akulov Denis <akulov.d.g@gmail.com>
 */
abstract class K_MVC_Path_Abstract {

    protected $controller = '';


    protected $method = '';


    protected $params = array();


    protected $isAjax = false;


    public function getController () {
        return $this->controller;
    }


    public function getMethod () {
        return $this->method;
    }


    public function getParams () {
        return $this->params;
    }


    public function isAjax () {
        return $this->isAjax;
    }


    protected function toLowerCamelCase () {
        if(count(explode('__', $this->method)) > 1) {
            die ('page not found: not implamented (6)');
        }

        if(count(explode('__', $this->controller)) > 1) {
            die ('page not found: not implamented (7)');
        }


        $arMethod = explode('_', $this->method);
        $tmpMethodName = '';
        foreach ($arMethod as $item) {
            $tmpMethodName .= ucfirst($item);
        }

        $this->method = strtolower(substr($tmpMethodName, 0, 1)).substr($tmpMethodName, 1);

        $arController = explode('_', $this->controller);
        $tmpControllerName = '';
        foreach ($arController as $item) {
            $tmpControllerName .= ucfirst($item);
        }

        $this->controller = $tmpControllerName;
    }

}